package com.ctc.lottery.common;

/**
 * 基于ThreadLocal封装工具类，用于保持和获取当前登录用户名
 */
public class BaseContext {
    private static final ThreadLocal<String> THREAD_LOCAL = new ThreadLocal<>();

    public static void setCurrentUserName(String userName){
        THREAD_LOCAL.set(userName);
    }

    public static String getCurrentUserName(){
        return THREAD_LOCAL.get();
    }
}
